<template>
  
  <div>
    
    <div id="aCoursesList">
      <!-- 网校课程 开始 -->
      <div>
        <section class="container">
          <header class="comm-title">
            <h2 class="tac">
              <span class="c-333">热门问答</span>
            </h2>
          </header>
          <div>
            <article class="comm-course-list">
              <ul class="of" id="bna">
                <li v-for="question in questionList" :key="question.id">
                  <div class="cc-l-wrap">
                    <section class="course-img">
                      <img
                        :src="question.cover"
                        class="img-responsive"
                        :alt="question.title"
                      >
                      <div class="cc-mask">
                        <a :href="'/search/' + question.id" title="查看详情" class="comm-btn c-btn-1">查看详情</a>
                      </div>
                    </section>
                    <h3 class="hLh30 txtOf mt10">
                      <a href="#" :title="question.title" class="course-title fsize18 c-333">{{question.title}}</a>
                    </h3>
                    <section class="mt10 hLh20 of">
                      <span class="fl jgAttr c-ccc f-fA">
                        <i class="c-999 f-fA">{{question.viewCount}}人浏览</i>
                      </span>
                    </section>
                  </div>
                </li>
              </ul>
              <div class="clear"></div>
            </article>
            <section class="tac pt20">
              <a href="/search" title="搜索问题" class="comm-btn c-btn-2">搜索问题</a>
            </section>
          </div>
        </section>
      </div>
      <!-- /网校课程 结束 -->
    </div>
  </div>
</template>

<script>
import question from '@/api/question'

export default {
  data () {
    return {
      questionList:[],
    }
  },
  created() {
    this.getHotQuestion()
  },
  methods: {
    // 查询热门问答
    getHotQuestion() {
      question.getHotQuestion()
        .then(response => {
          this.questionList = response.data.data.questionList
        })
    }
  }
}
</script>